package cn.hamster3.mc.plugin.ball.common.config;

import cn.hamster3.mc.plugin.core.common.config.ConfigSection;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.jetbrains.annotations.NotNull;

import java.util.List;

@Getter
@AllArgsConstructor
public class BallConfig {
    private boolean debug;
    @NotNull
    private String channelPrefix;
    private boolean gameServerUpdatePlayerInfo;
    private List<String> loadPlayerInfoFilter;

    public BallConfig(@NotNull ConfigSection config) {
        debug = config.getBoolean("debug", false);
        channelPrefix = config.getString("channel-prefix", "");
        channelPrefix = channelPrefix.isEmpty() ? channelPrefix : channelPrefix + ":";
        gameServerUpdatePlayerInfo = config.getBoolean("game-server-update-player-info", false);
        loadPlayerInfoFilter = config.getStringList("load-player-info-filter");
    }
}
